using Verse;

namespace RimWorld;

public class ThoughtWorker_HospitalPatientRoomStats : ThoughtWorker
{
	protected override ThoughtState CurrentStateInternal(Pawn p)
	{
		Building_Bed building_Bed = p.CurrentBed();
		if (building_Bed == null || !building_Bed.Medical)
		{
			return ThoughtState.Inactive;
		}
		Room room = p.GetRoom();
		if (room == null || room.Role != RoomRoleDefOf.Hospital)
		{
			return ThoughtState.Inactive;
		}
		int scoreStageIndex = RoomStatDefOf.Impressiveness.GetScoreStageIndex(room.GetStat(RoomStatDefOf.Impressiveness));
		if (def.stages[scoreStageIndex] != null)
		{
			return ThoughtState.ActiveAtStage(scoreStageIndex);
		}
		return ThoughtState.Inactive;
	}
}
